home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Games Machine 76
/
XENIATGM66.iso
/
Indiana Jones
/
Indiana Jones.exe
/
RESOURCE
/
PREVIEW.GOB
/
cog_shs_barrel.cog
< prev
next >
Wrap
Text File
|
1999-11-15
|
6KB
|
289 lines
# Jones 3D Cog Script
#
# shs_Barrel.cog Barrel falls if you take idol.
#
# [JWC] [RT]
#
# (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
#
# ===================================================================
symbols
message startup
message activated
message damaged
message touched
message callback
message timer
message entered
message pulse
cog talkCog local
keyframe smashed=in_die_buckle.key local
keyframe get=in_pickup_med.key local
#material brokenweb
sound sndDie=tem_temspikes_up_kill_c.wav local
sound sndStop=pru_boulder_crash_c.wav local
sound sndBarrel=olv_rockhead_roll_c.wav local
sound sndBrace=tem_tikikey_place_c.wav local
sound in_sensetrap=inxj041a.wav local # Sense a trap. (JC - filename changed)
sound mus_Cue=mus_gen_danger3.wav
surface idolspot mask=0x408
surface trigger
#surface webOut
#surface webIn
thing barrel
thing idol
thing brace
thing bombpos
thing posGhost
thing actorIndy
thing player local
thing idolitem local
int done=0 local # barrel rolled?
int rollloop local
int fragment=0 local
int i=0 local
int spoken=0 local
int vibe=0 local
vector dir local
vector posOffset local
vector angOffset local
template debris=woodshrapa local
template idoltpl=goldidol local
#SUBROUTINES
flex roll local
end
# ===================================================================
code
startup:
player = GetLocalPlayerThing();
ClearThingFlags(brace, 0x80);
ClearThingFlags(barrel, 0x80);
SetThingLight(idol, '0.2 0.2 0.2', 0.001, 0.01);
return;
# -------------------------------------------------------------------
activated:
if ((GetSenderRef() != idolspot) || (done == 1)) return;
if (GetCurItem(player) != 0) return;
done = 1;
MakeMeStop();
DeselectWeaponWait(player);
StartCutscene(0);
SetExtCamOffset('-0.15 -0.05 0.04');
SetExtCamLookOffset('0.0 0.02 -0.01');
TeleportThing(player, posGhost);
CaptureThing(player);
PlayKey(player, get, 5, 0x12, 0);
talkCog = GetCogByIndex(0);
SendMessage(talkCog, 27);
call roll;
return;
# -------------------------------------------------------------------
damaged:
# Make sure player is using whip
if ((GetSenderRef() != idolspot) || (GetParam(1) != 0x10) || (done == 1)) return;
done = 1;
idolitem = CreateThing(idoltpl, idol);
CaptureThing(idolitem);
DestroyThing(idol);
idol = -1;
dir = VectorAdd(GetThingPos(player), '0.0 0.0 0.3');
dir = VectorScale(VectorSub(dir, GetThingPos(idolitem)), 0.13);
ApplyForce(idolitem, dir);
SetTimer(1.5);
call roll;
return;
# -------------------------------------------------------------------
touched:
if ((GetSenderRef() != barrel) || (GetSourceRef() != player)) return;
SetCollideType(barrel, 0);
StartCutscene(0);
SetActorFlags(player, 0x200000);
StopThing(player);
CopyPlayerHolsters(player, actorIndy);
CopyOrientAndPos(player, actorIndy);
SetThingFlags(player, 0x10);
ClearThingFlags(actorIndy, 0x80000);
PlayKey(actorIndy, smashed, 10, 0x14, 0);
PlaySoundLocal(sndDie, 1.0, 0.0, 0x0, 0);
DamageThing(player, 1000, 0x80, barrel);
ClearActorFlags(player, 0x200000);
EndCutscene();
return;
# -------------------------------------------------------------------
callback:
ReleaseThing(player);
if (idol != -1)
{
DestroyThing(idol);
idol = -1;
}
ChangeInv(player, 36, 10);
SetInvAvailable(player, 36, 1);
JonesInvItemChanged(35);
RestoreExtCam();
ClearActorFlags(player, 0x200000);
EndCutscene();
return;
# -------------------------------------------------------------------
entered:
if ((GetSenderRef() == trigger) && (spoken == 0))
{
spoken=1;
PlaySoundLocal(mus_Cue, 1.0, 0.0, 0x0, 0);
sleep(1);
PlayVoice(player, in_sensetrap, 1, 0);
}
return;
# -------------------------------------------------------------------
timer:
SetThingVel(idolitem, '0 0 0');
return;
# -------------------------------------------------------------------
roll:
SetCollideType(brace, 0);
MoveToFrame(brace, 1, 4.0);
#kchunk sound
PlaySoundLocal(sndBrace, 1.0, 0.0, 0x0, 1);
MoveToFrame(barrel, 1, 8.0);
#sound of barrel rolling
rollloop=PlaySoundLocal(sndBarrel, 1.0, 0.0, 0x1, 0);
setpulse(.1);
WaitForStop(barrel);
StopSound(rollloop, 0.0);
DestroyThing(barrel);
for(i = 0; i < 8; i = i + 1)
{
fragment = CreateThing(debris, bombpos);
SetCollideType(fragment, 0);
SetThingVel(fragment, VectorScale(VectorAdd(RandVec(), '-0.05 -0.01 0.0'), 1.0));
}
#sound of barrel explode
PlaySoundLocal(sndStop, 1.0, 0.0, 0x0, 0);
setpulse(0.0);
return;
# ========================================================================================
pulse:
vibe = RandBetween(1, 4);
if (vibe == 1)
{
posOffset = '-0.008 0.00 -0.002'; #1 was .005x
angOffset = '0.00 -0.002 0.002';
}
if (vibe == 2)
{
posOffset = '0.008 -0.005 0.002'; #2 was .005x
angOffset = '0.002 0.00 -0.002';
}
if (vibe == 3)
{
posOffset = '0.005 0.005 -0.005'; #3 was .002x
angOffset = '-0.002 0.005 -0.005';
}
if (vibe == 4)
{
posOffset = '-0.002 0.00 0.005'; #4
angOffset = '0.00 0.00 0.002';
}
vibe = RandBetween(1, 3);
if (vibe == 1)
{
SetPulse(0.05);
}
if (vibe == 2)
{
SetPulse(0.1);
}
if (vibe == 3)
{
SetPulse(0.15);
}
SetPOVShake(posOffSet, angOffSet, 200.0, 200.0);
return;
# ========================================================================================
end